<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class StoreServiceRecord extends Model
{
    use HasFactory;

    /**
     * 审核状态枚举
     */
    public  $type = [
        'pc' => 'pc',
        'weChat' => '微信',
        'applet' => '小程序',
        'H5' => 'H5',
    ];

    /**
     * 审核状态枚举
     */
    public  $newsTypeEnum = [
        'writtenWords' => '文字',
        'expression' => '表情',
        'picture' => '图片',
        'voice' => '语音',
    ];

    /**
     * 默认倒序
     */
    protected $defaultSortCriteria = ['id,desc'];

    /**
     * 关联用户模型
     */
    public function user(){
        return $this->belongsTo(User::class,'receiver_user_id','id');
    }

    /**
     * 关联客服模型
     */
    public function storeService(){
        return $this->belongsTo(StoreService::class,'sender_service_id','id');
    }
}
